
<%@taglib prefix="s" uri="/struts-tags"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.util.*"%>
<%@ page import="pe.edu.upc.dew.profesoresparticulares.model.Horario"%>
<%@ page import="pe.edu.upc.dew.profesoresparticulares.model.Usuario"%>
<%@ page import="pe.edu.upc.dew.profesoresparticulares.util.Constantes"%>


<%List<Map> menus = (List<Map>)request.getSession().getAttribute("MENU");%>
<%ArrayList<Horario> horariosProfesor = (ArrayList<Horario>) request.getAttribute("horariosReservados");%>
<%Usuario objUsuario = (Usuario)request.getSession().getAttribute(Constantes.USUARIO);%>

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Bienvenido | Profesores Particulares</title>
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
        <meta name="author" content="fullahead.org" />
        <meta name="keywords" content="XHTML, CSS, template, FullAhead" />
        <meta name="description" content="A valid, XHTML 1.0 template" />
        <meta name="robots" content="index, follow, noarchive" />
        <meta name="googlebot" content="noarchive" />

        <link rel="stylesheet" type="text/css" href="css/html.css" media="screen, projection, tv " />
        <link rel="stylesheet" type="text/css" href="css/layout.css" media="screen, projection, tv" />
        <link rel="stylesheet" type="text/css" href="css/print.css" media="print" />

    </head>

    <body>
        <!-- #wrapper: centers the content and sets the width -->
        <div id="wrapper">
            <!-- #content: applies the white, dropshadow background -->
            <div id="content">
                <div id="header">
                    <h1><span class="big darkBrown">P</span>rofesores <span class="big darkBrown">P</span>articulares</h1>
                    <h2><span class="highlight">Reserva tu curso y profesor favorito en un par de clicks.</span></h2>
                </div>

                <ul id="menu" class="six">
                    <%for (int i = 0; i < menus.size(); i++) {%>
                    <li><a href="<%=request.getContextPath()%>/<%=((Map) menus.get(i)).get("url")%>" title="" class="here">
                            <span class="big"></span>
                            <%=((Map) menus.get(i)).get("descripcion")%>
                        </a></li>

                    <% }%>
                </ul>
                <!-- #page: holds all page content, as well as footer -->
                <div id="page">

        

            <s:form action="cancelarReserva">

            <table width="500" border="1" align="center">

                 <tr>
                    <td><strong>Codigo Horario</strong></td>
                    <td><strong>Profesor</strong></td>
                    <td><strong>Fecha</strong></td>
                    <td><strong>Hora</strong></td>
                    <td><strong>Lugar</strong></td>
                     <td></td>

                </tr>

                  <%for(Horario h : horariosProfesor){%>
                    <%if (h.getCodAlumno()== objUsuario.getCodUsuario()) {%>

                        <tr>
                             <td><%=h.getCodHorario()%></td>
                             <td><%=h.getNomProfesor()%></td>
                             <td><%=h.getFecha()%></td>
                             <td><%=h.getDescHora()%></td>
                             <td><%=h.getLugar()%></td>
                             <td><input type="radio" name="codHorarioReserva" value= <%=h.getCodHorario()%> /></td>
                        </tr>
                    <% }%>
                <% }%>

            </table>


                <table width="500" border="0" align="center">
                            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                            <td>
                                <input type="button" name="BorrarHorario" value="Borrar Horario" onclick="prueba()" />
                            </td>
                            <td>&nbsp;</td>
                 </table>
                 
        </s:form>

                    <p class="footer">
                        Design by <a href="http://fullahead.org" title="Visit FullAhead">FullAhead</a>.  Valid CSS &amp; XHTML with no rights reserved.
                    </p>

                </div>

            </div>

        </div>

    </body>

</html>

<SCRIPT language="JavaScript">

function prueba() {
if (confirm('¿Estás que deseas cancelar la reserva?')){
    document.forms[0].submit();
    return true;
    }

}


</SCRIPT>